﻿<script type="text/javascript">
    $.parser.onComplete = function () {
        var d = new Date();
        $("#shigong_riqi_kaishi_luji").datebox('setValue', d.toLocaleDateString());
        $("#shigong_riqi_jeishu_luji").datebox('setValue', d.toLocaleDateString());

        $("#zhandian_luji").combobox({
            url: 'json/zhandian.json',
            method: 'get',
            valueField: 'zhandian',
            textField: 'zhandian',
            panelWidth: 200,
            panelHeight: 'auto',
            editable: false,
            onLoadSuccess: function () {
                $("#shigong_luji").datagrid({
                    url: "handler/hesuan_shigong_luji.ashx",
                    method: "get",
                    queryParams: {
                        uid: window.uid,
                        kid: window.kid,
                        kaishi: $("#shigong_riqi_kaishi_luji").datebox('getValue'),
                        jieshu: $("#shigong_riqi_jeishu_luji").datebox('getValue'),
                        gonglihao1: $("#shigong_gonglhao1_luji").textbox('getText'),
                        dian1: $("#shigong_dian1_luji").textbox('getText'),
                        gonglihao2: $("#shigong_gonglhao2_luji").textbox('getText'),
                        dian2: $("#shigong_dian2_luji").textbox('getText'),
                        zhandian: $("#zhandian_luji").combobox('getValue')
                    },
                    height: document.body.scrollHeight - 180,
                    onLoadSuccess: function (data) {
                        $(this).datagrid('autoMergeCells', ["biaoduanmingcheng"]);
                    },
                    loadFilter: function (data) {
                        for (var i = 0; i < data.length; i++) {
                            if (data[i].riqi) {
                                data[i].riqi = data[i].riqi;
                            }
                            else {
                                data[i].riqi = '合计：';
                            }
                        }
                        return data;
                    }
                });
            }
        });
    }



    $("#shigong_chaxun_luji").click(function () {
        $("#shigong_luji").datagrid('load', {
            uid: window.uid,
            kid: window.kid,
            kaishi: $("#shigong_riqi_kaishi_luji").datebox('getValue'),
            jieshu: $("#shigong_riqi_jeishu_luji").datebox('getValue'),
            gonglihao1: $("#shigong_gonglhao1_luji").textbox('getText'),
            dian1: $("#shigong_dian1_luji").textbox('getText'),
            gonglihao2: $("#shigong_gonglhao2_luji").textbox('getText'),
            dian2: $("#shigong_dian2_luji").textbox('getText'),
            zhandian: $("#zhandian_luji").combobox('getValue')
        });
    });

    $("#shigong_daochu_luji").click(function () {
        //导出
        var dateKaiShi = $("#shigong_riqi_kaishi_luji").datetimebox('getValue');
        var dateJieShu = $("#shigong_riqi_jeishu_luji").datetimebox('getValue');
        var zhanDianStr = $("#zhandian_luji").combobox('getText').replace('#', "_");
        var yongHu = $("#currentUser").text();
        window.open(encodeURI("http://keaomds.com:10001/?uid=" + window.uid + "&kid=" + window.kid + "&requestType=9&keHuBianHao=" + window.kehubianhao + "&zhandian=" + zhanDianStr + "&kaishi=" + dateKaiShi + "&jieshu=" + dateJieShu + "&yonghu=" + yongHu));

    });

</script>

<div class="easyui-panel" data-options="height:90,border:false" title="数据检索" style="border-top-width: 0px;
    border-bottom-width: 1px; padding: 15px; width:100%">
    <table style="font-size: 12px;">
        <tr>
            <td>
                站点：
            </td>
            <td>
                <input class="easyui-combobox" id="zhandian_luji" style="width: 175px;" />
            </td>
            <td>
                施工日期：
            </td>
            <td>
                <input id="shigong_riqi_kaishi_luji" type="text" class="easyui-datebox" data-options="required:true"
                       style="width: 120px">
                至
                <input id="shigong_riqi_jeishu_luji" type="text" class="easyui-datebox" data-options="required:true"
                       style="width: 120px">
            </td>
            <td>
                桩号：
            </td>
            <td>
                K<input id="shigong_gonglhao1_luji" type="text" name="shigong_gonglhao1_luji" class="easyui-textbox" data-options=""
                       style="width: 70px">
                <input id="shigong_dian1_luji"  type="text" name="shigong_dian1_luji" class="easyui-textbox" data-options=""
                       style="width: 70px">
            </td>
            <td>
                —
            </td>
            <td>
                K<input id="shigong_gonglhao2_luji"  type="text" name="shigong_gonglhao1_luji" class="easyui-textbox" data-options=""
                        style="width: 70px">
                <input id="shigong_dian2_luji"  type="text" name="shigong_dian1_luji" class="easyui-textbox" data-options=""
                       style="width: 70px">
            </td>
            <td>
                <a id="shigong_chaxun_luji" class="easyui-linkbutton" data-options="iconCls:'icon-search'"
                   style="width: 60px; margin-left: 20px;">查询</a>
            </td>
            <td>
                <a id="shigong_daochu_luji" class="easyui-linkbutton" data-options="iconCls:'icon-export-16'"
                   style="width: 60px">导出</a>
            </td>
        </tr>
    </table>
</div>

<table id="shigong_luji" class="easyui-datagrid" title="路基施工查询" data-options="border:false,singleSelect:true,collapsible:false,striped:true,fitColumns:true" style="width:100%">
    <thead>
        <tr>
            <th data-options="field:'riqi'">
                施工日期
            </th>
            <th data-options="field:'biaoduanmingcheng'">
                桩号
            </th>
            <th data-options="field:'gongcheng'">
                分项工程
            </th>
            <th data-options="field:'zuoyoufu'">
                左右幅
            </th>
            <th data-options="field:'biaoduanchangdu'">
                长度(m)
            </th>
            <th data-options="field:'biaoduankuandu'">
                宽度(m)
            </th>
            <th data-options="field:'biaoduanhoudu'">
                厚度(m)
            </th>
            <th data-options="field:'ganmidu'">
                最大干密度(t/m³)
            </th>
            <th data-options="field:'jihualiang'">
                设计用量(t)
            </th>
            <th data-options="field:'jingzhong'">
                过磅重量(t)
            </th>
            <th data-options="field:'hanshuiliang'">
                含水率(%)
            </th>
            <th data-options="field:'shigongganzhong'">
                施工干重(t)
            </th>
            <th data-options="field:'wuchaliang'">
                混合料盈亏(t)
            </th>
            <th data-options="field:'yingkui'">
                盈亏比例(%)
            </th>
        </tr>
    </thead>
</table>